<template>
  <div>{{ count }}</div>
  <div>666</div>
  <el-button icon="Edit" type="primary">编辑</el-button>
  <el-button @click="adBtn" type="success">新增</el-button> //按钮点击连到addBtn函数上
  <el-button type="info">Info</el-button>
  <el-button type="warning">Warning</el-button>
  <el-button icon="close" type="danger">关闭</el-button>
  <el-icon>
      <Edit />
    </el-icon>
</template>

<script setup lang="ts">
import { computed} from 'vue'
import { testStore } from '@/store/test/index';
//获取store
const store = testStore()
//从store里获取count
const count = computed(()=>{
  return store.getCount
});
//改变store里的值
const adBtn = ()=>{
  store.setCount(++store.count)//使用在store/test/index中的setCount函数，让store中的数据count++，使用方法如左
}
</script>

<style scoped>
.read-the-docs {
  color: #888;
}
</style>
